package com.armani.mapper;

import com.armani.entity.Order;
import com.armani.model.OrderModel;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @ProjectName: armani
 * @Package: com.armani.mapper
 * @ClassName: OrderMapper
 * @Description: 订单接口映射类
 * @Author: lenovo
 * @Date: 2021/11/28 23:08
 * @Version: 1.0
 **/
public interface OrderMapper {
    /**
     * 查询订单列表展示（条件检索+分页）
     * @param params 检索条件集合
     * @return 订单列表集合
     */
    List<OrderModel> search(Map<String, Object> params);
    /**
     * 获取订单列表总条数
     * @param params 检索条件集合
     * @return 订单列表总条数
     */
    Integer count(Map<String, Object> params);
    /**
     * 添加商品信息到快照
     * @param itemName
     * @param ItemParam
     * @param price
     * @param num
     * @param orderTime
     * @param totalPrice
     * @param orderId
     * @param shopUser
     * @param phone
     * @param province
     * @param city
     * @param district
     * @param detail
     * @param note
     * @return
     * @throws Exception
     */
    Integer insertSnapshot(String itemName, String ItemParam, BigDecimal price, Integer num,
                           Date orderTime, BigDecimal totalPrice, Integer orderId,
                           String shopUser, String phone, String province,
                           String city, String district, String detail, String note)throws Exception;

    /**
     * 删除订单（逻辑删除）
     * @Param userId 用户id
     * @return
     * @throws Exception
     */
    Integer del(@Param(value = "userId") Integer userId)throws Exception;
}
